package cn.fl.ref.asspackinfo.service;

import java.util.List;
import java.util.Map;

import cmm.mid.core.framework.dto.DataResultDTO;
import cmm.mid.core.framework.page.KeyValueVO;
import cmm.mid.core.framework.page.Pager;
import cn.cmm.base.framework.exception.BaseException;
import cn.fl.ref.asspackinfo.vo.AssPackInfoVO;
import cn.fl.ref.asspackinfo.vo.AssPackListVO;
import cn.fl.ref.asspackinfo.vo.AssPackOccupyDetailVO;
import cn.fl.ref.asspackinfo.vo.FncPrjPayRltvInfoReplaceVO;
import cn.fl.ref.asspackinfo.vo.FncPrjPayRltvInfoVO;
import cn.fl.ref.asspackinfo.vo.RecordReplaceAssPackVO;
import fl.flow.facade.flow.dto.FlowStartParamsDTO;
import fl.ref.asspackinfo.condition.AssPackInfoQueryCondition;
import fl.ref.asspackinfo.dto.AssPackInfoReplaceDTO;
import fl.ref.asspackinfo.dto.AssPackListDTO;
import fl.ref.asspackinfo.dto.FncPrjPayRltvInfo2DTO;
import fl.ref.asspackinfo.dto.FncPrjPayRltvInfoDTO;
import fl.ref.asspackinfo.dto.FncPrjPayRltvInfoReplaceDTO;

/**
 * 融资筛选
 * @author mrzhang
 * 
 */
public interface IAssPackInfoService {

	/**
	 * 数据字典项
	 * 
	 * @param grpCd
	 * @return
	 * @throws BaseException
	 */
	public List<KeyValueVO> getKvList(String grpCd) throws BaseException;
	
	/**
	 * 数据字典项（所属事业部）
	 * 
	 * @param grpCd
	 * @return
	 * @throws BaseException
	 */
	public List<KeyValueVO> getCodeDescList(String grpCd) throws BaseException;
	
	/**
	 * 分页查询所有
	 * @param page
	 * @return
	 */
	public Pager searchListPage(Pager page) throws BaseException; 
	
	/**
	 * 分页查询资产包所有
	 * @param page
	 * @return
	 */
	public Pager searchPackInfoListPage(Pager page) throws BaseException; 
	
	/**
	 * 分页查询资产包所有
	 * @param page
	 * @return
	 */
	public Pager searchPaySchInfoList(Pager page) throws BaseException; 
	
	/**
	 * 添加资产包
	 * @param assPackInfo
	 * @param payRltvInfo
	 * @return
	 * @throws BaseException
	 */
	public boolean add(AssPackInfoVO assPackInfo, String payRltvInfo, String termB,String termE,String mark,List<String> oldPaySchCds) throws BaseException;
		
	/**
	 * 根据id查询资产包信息
	 * @param id
	 * @param sysCd
	 * @param orgCd
	 * @return
	 * @throws BaseException
	 */
	public AssPackInfoVO selectById(long id, String sysCd, String orgCd) throws BaseException;
	
	/**
	 * 删除资产包
	 * @param payRltvInfo
	 * @return
	 * @throws BaseException
	 */
	public boolean deletePayRltvInfo(String payRltvInfo, String assPackId) throws BaseException;
	
	/**
	 * 根据资产包id及筛选条件查询所有资产包信息
	 * @param condition
	 * @return
	 */
	public List<AssPackListVO> searchAssPackList(AssPackInfoQueryCondition condition) throws BaseException; 
	
	/**
	 * 根据资产包ID获取融资项目与支付关联表信息
	 * @param id
	 * @return
	 */
	public List<FncPrjPayRltvInfoVO> selectByAssPackId(Long id) throws BaseException;
	
	/**
	 * 分页查询资产包下的支付表信息
	 * @param page
	 * @return
	 */
	public Pager searchReplaceListPage(Pager page) throws BaseException;
    
	/**
	 * 添加替换资产包
	 * @param vo
	 * @return
	 * @throws BaseException
	 */
	public long replaceAndAddAssPackInfo(FncPrjPayRltvInfoReplaceVO vo) throws BaseException;
	
	/**
	 * 修改替换资产包
	 * @param vo
	 * @return
	 * @throws BaseException
	 */
	public boolean modifyReplaceAssPackInfo(FncPrjPayRltvInfoReplaceVO vo) throws BaseException;
	
	/**
	 * 替换资产包记录查询
	 * @param assPackId
	 * @return
	 * @throws BaseException
	 */
	public List<RecordReplaceAssPackVO> recordReplaceAssPackInfo(Long assPackId) throws BaseException;
	
	/**
	 * 启动流程
	 * @param flowStartParamsDTO
	 * @return
	 * @throws BaseException
	 */
	public DataResultDTO addFlowStart(FlowStartParamsDTO flowStartParamsDTO) throws BaseException;
	
	/**
     * 根据资产包id查询资产包记录"预替换"关联的支付信息
     * @param assPackId
     * @return
     * @throws BaseException
     */
	public List<FncPrjPayRltvInfoReplaceDTO> getPayIdsByAssPackId(Long assPackId) throws BaseException;
    
	/**
	 * 根据资产包id查询资产包记录"已替换"关联的支付支付信息
	 * @param assPackId
	 * @return
	 * @throws BaseException
	 */
	public List<FncPrjPayRltvInfoReplaceDTO> getReplacePayIdsByAssPackId(Long assPackId) throws BaseException;
	
	/**
	 * 查询资产包替换记录信息
	 * @param dto
	 * @return
	 * @throws BaseException
	 */
	public AssPackInfoReplaceDTO getAssPackInfoReplace(AssPackInfoReplaceDTO dto) throws BaseException;
	
	/**
	 * 根据资产包id查询资产包替换记录信息
	 * @param dto
	 * @return
	 * @throws BaseException
	 */
	public List<AssPackInfoReplaceDTO> getAssPackInfoReplaceList(AssPackInfoReplaceDTO dto) throws BaseException;
	
	/**
	 * 删除资产包与支付关系表记录
	 * @param dto
	 * @return 
	 * @throws BaseException
	 */
	public boolean deleteFncPrjPayRltvInfoReplaceInfo (FncPrjPayRltvInfoReplaceDTO dto) throws BaseException;
	
	/**
	 * 获取资产包占用详情
	 * @param vo
	 * @return
	 * @throws BaseException
	 */
	public List<AssPackOccupyDetailVO> getAssPackOccupyDetail (AssPackListVO vo) throws BaseException;
	
	/**
	 * 资产包复制
	 * @param assPackId
	 * @param assPackNm
	 * @return
	 * @throws BaseException
	 */
	public boolean copyAssPackInfo(String assPackId, String assPackNm) throws BaseException;
	
	/**
	 * 更新再融资状态支付期数占用区间
	 * @param po
	 * @return
	 * @throws BaseException
	 */
	public int updatePayRltvInfo(FncPrjPayRltvInfoDTO dto) throws BaseException;
	/**
	 * 查询资产包关联支付表信息 旧支付表
	 * @param dto
	 * @return
	 * @throws BaseException
	 * 2018年2月12日 
	 * lxb
	 */
	public List<FncPrjPayRltvInfo2DTO> selectOldByAssPackId(Long id) throws BaseException;
	/**
	 * 清空资产包
	 * @param assPackId
	 * @return
	 * @throws BaseException
	 */
	public boolean deletePayRltvInfoAll(Long assPackId) throws BaseException;
	
	/**
	 * 不分页查询所有资产包列表
	 * @param condition
	 * @return
	 */
	public List<AssPackListDTO> searchList(AssPackInfoQueryCondition condition) throws BaseException;
	/**
	 *    逾期天数大于30天的支付表的逾期金额总和 
	 *    逾期天数大于90天的支付表的逾期金额总和
	 * @param ASS_PACK_ID 资产包ID
	 * @return
	 * @throws BaseException
	 */
	List<Map<String, Object>>  getOvdAmtSumByAssPackId(String assPackIdstr) throws BaseException;
	/**
	 *     资产包总的敞口（剩余租金）
	 * @param ASS_PACK_ID 资产包ID transtm提款管理 到账时间
	 * @return
	 * @throws BaseException
	 */
	List<Map<String, Object>>  getSurplusRentByAssPackId(String assPackIdstr,String transtm) throws BaseException;

	/**
	 * 抵押记录数据
	 * @return
	 */
	public Pager mortgageList(Pager Page) throws BaseException ;

}
